# -*- coding: utf-8 -*-
'''
Created on 20 de Abr de 2011

@author: Samuel
'''
#para o servidor http
import SimpleHTTPServer
import SocketServer
import threading

class createServer (threading.Thread):
    
    def __init__(self, nome = ''):
        threading.Thread.__init__(self)
        self.nom = nome
    
    
    def run(self):
#        if self.Terminated == False:
        PORT = 8000
        self.Handler = SimpleHTTPServer.SimpleHTTPRequestHandler        
        self.httpServ = SocketServer.TCPServer(("", PORT), self.Handler)
        self.httpServ.serve_forever() 
        
    def stopServer(self):
        try:
            self.httpd.server_close()
        except: print '' 